﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="~/Content/MainPage/mainPage.css" media="all" />
    <script src="~/Scripts/mainPage/mainPage.js?v=@DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")"  type="text/javascript"></script>
    <script src="~/Scripts/echarts.min.js"></script>
    <script src="~/Scripts/jquery-3.3.1.min.js"></script>
    <title>德器物联</title>
</head>
<body>
    <div>
        <div class="main-page_top">
            <div class="main-page_top_logo">
                <p onclick="goMap()">@ViewBag.NickName &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp地图显示</p>

                <p onclick="dropOut()">退出</p>

            </div>
            <div class="main-page_top_count">
                <div>联网点</div>
                <div class="count_blank">@ViewBag.SumNum</div>
                <div>台 </div>
                <div> 开</div>
                <div class="count_blank">@ViewBag.OnLineNum</div>
                <div> 台 关</div>
                <div class="count_blank">@ViewBag.OffLineNum</div>
                <div>故障</div>
                <div class="count_blank">0</div>
                <div>台 超标</div>
                <div class="count_blank">0</div>
                <div>台</div>
            </div>
            <div class="main-page_top_tab">
                <div class="tab-item active">开机设备</div>
                <div class="tab-item">关机设备</div>
                <div class="tab-item">故障设备</div>
                <div class="tab-item">超标设备</div>
            </div>
        </div>

        <div class="main-page_search">
            <div class="search_input">
                <input type="text" name="search" placeholder="店名" />
                <div class="search_button">搜索</div>
            </div>
        </div>

        <div class="main-page_content">
            @for (int i = 0; i < ViewBag.DeviceData.Count; i++)
            {
                if (ViewBag.DeviceData[i]["ChannelNum"].ToString() == "1")
                {
                    <div class="content_item" onclick="showDetailModal('@ViewBag.DeviceData[i]["MN"]',this)">
                        <div class="content_item_left">
                            <div class="shop_name">
                                @ViewBag.DeviceData[i]["Name"]
                            </div>
                            <div class="shop_address">
                                @ViewBag.DeviceData[i]["Address"]
                            </div>
                            <div class="shop_datas">
                                <div class="datas_left">
                                    <div class="left_top">
                                        <span>NMHC: </span>
                                        @if (double.Parse(ViewBag.DeviceData[i]["V1"].ToString()) > 10)
                                        {
                                            <div domname="V1" style="background-color:red">@ViewBag.DeviceData[i]["V1"]mg/m³</div>
                                        }
                                        else
                                        {
                                            <div domname="V1">@ViewBag.DeviceData[i]["V1"]mg/m³</div>
                                        }
                                    </div>
                                    <div class="clear"></div>
                                </div>
                                <div class="datas_right">
                                    <div class="right_top">
                                        <span>颗粒物: </span>
                                        @if (double.Parse(ViewBag.DeviceData[i]["K1"].ToString()) > 10)
                                        {
                                            <div domname="K1" style="background-color:red">@ViewBag.DeviceData[i]["K1"]mg/m³</div>
                                        }
                                        else
                                        {
                                            <div domname="K1">@ViewBag.DeviceData[i]["K1"]mg/m³</div>
                                        }

                                    </div>
                                    <div class="clear"></div>
                                </div>
                                <div class="clear"></div>
                            </div>
                        </div>
                        <div class="content_item_right">

                            @if (double.Parse(ViewBag.DeviceData[i]["Y1"].ToString()) > 1)
                            {
                                <div class="state_gif" style="color:red" domname="Y1">
                                    @ViewBag.DeviceData[i]["Y1"]
                                </div>
                            }
                            else
                            {
                                <div class="state_gif" domname="Y1">
                                    @ViewBag.DeviceData[i]["Y1"]
                                </div>
                            }

                            <div class="mgm">
                                mg/m³
                            </div>
                            <div class="state_name">
                                油烟浓度
                            </div>
                        </div>
                    </div>
                }
                else
                {
                    <div class="content_item" onclick="showDetailModal('@ViewBag.DeviceData[i]["MN"]',this)">
                        <div class="content_item_left">
                            <div class="shop_name">
                                @ViewBag.DeviceData[i]["Name"]
                            </div>
                            <div class="shop_address">
                                @ViewBag.DeviceData[i]["Address"]
                            </div>
                            <div>通道1：</div>
                            <div class="shop_datas">
                                <div class="datas_left">

                                    <div class="left_top">
                                        <span>NMHC: </span>
                                        @if (double.Parse(ViewBag.DeviceData[i]["V1"].ToString()) > 10)
                                        {
                                            <div domname="V1" style="background-color:red">@ViewBag.DeviceData[i]["V1"]mg/m³</div>
                                        }
                                        else
                                        {
                                            <div domname="V1">@ViewBag.DeviceData[i]["V1"]mg/m³</div>
                                        }

                                    </div>
                                    <div class="clear"></div>
                                </div>
                                <div class="datas_right">
                                    <div class="right_top">
                                        <span>颗粒物: </span>

                                        @if (double.Parse(ViewBag.DeviceData[i]["K1"].ToString()) > 10)
                                        {
                                            <div domname="K1" style="background-color:red">@ViewBag.DeviceData[i]["K1"]mg/m³</div>
                                        }
                                        else
                                        {
                                            <div domname="K1">@ViewBag.DeviceData[i]["K1"]mg/m³</div>
                                        }
                                    </div>
                                    <div class="clear"></div>
                                </div>
                                <div class="clear"></div>
                            </div>
                            <div>通道2：</div>
                            <div class="shop_datas">
                                <div class="datas_left">

                                    <div class="left_top">
                                        <span>NMHC: </span>
                                        @if (double.Parse(ViewBag.DeviceData[i]["V2"].ToString()) > 10)
                                        {
                                            <div domname="V1" style="background-color:red">@ViewBag.DeviceData[i]["V1"]mg/m³</div>
                                        }
                                        else
                                        {
                                            <div domname="V1">@ViewBag.DeviceData[i]["V2"]mg/m³</div>
                                        }

                                    </div>
                                    <div class="clear"></div>
                                </div>
                                <div class="datas_right">
                                    <div class="right_top">
                                        <span>颗粒物: </span>
                                        @if (double.Parse(ViewBag.DeviceData[i]["K2"].ToString()) > 10)
                                        {
                                            <div domname="K1" style="background-color:red">@ViewBag.DeviceData[i]["K2"]mg/m³</div>
                                        }
                                        else
                                        {
                                            <div domname="K1">@ViewBag.DeviceData[i]["K2"]mg/m³</div>
                                        }
                                    </div>
                                    <div class="clear"></div>
                                </div>
                                <div class="clear"></div>
                            </div>
                        </div>
                        <div class="content_item_right">
                            @*<div class="state_text">
                                -
                            </div>*@
                            @if (double.Parse(ViewBag.DeviceData[i]["Y1"].ToString()) > 1)
                            {
                                <div class="state_gif" style="color:red" domname="Y1">
                                    @ViewBag.DeviceData[i]["Y1"]
                                </div>
                            }
                            else
                            {
                                <div class="state_gif" domname="Y1">
                                    @ViewBag.DeviceData[i]["Y1"]
                                </div>
                            }
                            <div class="mgm">
                                mg/m³
                            </div>
                            <div class="state_name">
                                油烟浓度
                            </div>
                        </div>
                        <div class="content_item_right">
                            @*<div class="state_text">
                                -
                            </div>*@
                            @if (double.Parse(ViewBag.DeviceData[i]["Y2"].ToString()) > 1)
                            {
                                <div class="state_gif" style="color:red" domname="Y1">
                                    @ViewBag.DeviceData[i]["Y2"]
                                </div>
                            }
                            else
                            {
                                <div class="state_gif" domname="Y1">
                                    @ViewBag.DeviceData[i]["Y2"]
                                </div>
                            }
                            <div class="mgm">
                                mg/m³
                            </div>
                            <div class="state_name">
                                油烟浓度
                            </div>
                        </div>
                    </div>
                }



            }


        </div>
        <div id="footdiv" style="font-size:12px;margin-top:10px;margin-bottom:10px;width:100%;position:absolute;left: 0px;bottom: 0px;text-align:center">
            ©2020 德器(重庆)科技有限公司 服务热线 400-9019-505
            @*重庆环元环境科学研究院*@
        </div>

        <div id="tabModal" class="hidden_modal tab_modal"></div>
        <div id="hideModal" class="hidden_modal hide_modal" onclick="closeModal()">
            <div class="mask_ywh myfirst" style="font-size: 10rem;">
                <div class="font5" id="TabY1">0.3</div>
                <div class="mask_ywh_m">油烟浓度mg/m³</div>
            </div>
        </div>
        <div id="detailModal" class="bottom_modal hide_modal">
            <div class="top_gif">
                <img src="~/Content/Img/xing.gif" />
            </div>
            <div class="mask_text">
                <div class="mask_texta">
                    <div class="left nav_t">NMHC：</div>
                    <div id="TabV1" class="left nav_t col">1.2mg/m³</div>
                    <div class="left nav_t">颗粒物：</div>
                    <div id="TabK1" class="left nav_t col">0.9mg/m³</div>
                    <div class="clear"></div>
                </div>
                <div class="mask_texta">
                    @*<div class="left nav_t">排风机状态：</div>
                    <div id="sfl" class="left nav_t col">开</div>
                    <div style="margin-left:2rem;" class="left nav_t">油烟净化器状态：</div>
                    <div id="vm" class="left nav_t col">开</div>*@
                    <a class="mask_contents" href=""><img src="~/Content/Img/text.png"></a>
                    <div class="clear"></div>
                </div>
            </div>
            <div class="data_chart">
                <div id="main" style="width: 100%;height:20rem"></div>
            </div>
        </div>

    </div>
</body>
</html>
